<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp" %>
<!doctype html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><sitemesh:write property="title"/></title>
<link type="text/css" rel="stylesheet" href="${ctx }/js/jqueryValidator/validationEngine.jquery.css"/>

<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="${ctx }/css/bootstrap/bootstrap.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/font-awesome.css" />


<link rel="stylesheet" href="${ctx }/css/bootstrap/project.css" />

<!-- page specific plugin styles -->
<link rel="stylesheet" href="${ctx }/css/bootstrap/jquery-ui.custom.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/chosen.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/datepicker.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/bootstrap-timepicker.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/daterangepicker.css" />
<link rel="stylesheet" href="${ctx }/css/bootstrap/bootstrap-datetimepicker.css" />

<!-- text fonts -->
<link rel="stylesheet" href="${ctx }/css/bootstrap/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet" href="${ctx }/css/bootstrap/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

<!--[if lte IE 9]>
    <link rel="stylesheet" href="${ctx }/css/bootstrap/ace-part2.css" class="ace-main-stylesheet" />
<![endif]-->

<!--[if lte IE 9]>
  <link rel="stylesheet" href="${ctx }/css/bootstrap/ace-ie.css" />
<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script src="${ctx }/js/bootstrap/ace-extra.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
<script src="${ctx }/js/bootstrap/html5shiv.js"></script>
<script src="${ctx }/js/bootstrap/respond.js"></script>
<![endif]-->
<sitemesh:write property="head"/>
</head>
<body class="no-skin">
	<div class="navbar navbar-default" id="navbar"><!-- 头部 -->
		<%@ include file="/common/header.jsp" %>
	</div>
	<div class="main-container" id="main-container"><!-- 头部以下-->
		<script type="text/javascript">
            try{ace.settings.check('main-container' , 'fixed')}catch(e){}
        </script>
        <div class="main-container-inner">
        	<a class="menu-toggler" id="menu-toggler" href="#">
                <span class="menu-text"></span>
            </a>
            <div class="sidebar" id="sidebar"><!-- 左侧菜单 -->
            	<%@ include file="/common/left.jsp"%>
            </div><!-- #sidebar -->
            <div class="main-content">
            	<sitemesh:write property="body"/>
            </div>
        </div>
	</div>
<!-- basic scripts -->
 <!--[if !IE]> -->

 	<script src="${ctx }/js/bootstrap/jquery-1.10.2.min.js"></script>

    <!-- <![endif]-->

    <!--[if !IE]> -->

    <script type="text/javascript">
		window.jQuery || document.write("<script src='${ctx}/js/bootstrap/jquery.js'>"+"<"+"/script>");
	</script>

    <!-- <![endif]-->

    <!--[if IE]>
    <script type="text/javascript">
    window.jQuery || document.write("<script src='${ctx}/js/bootstrap/jquery1x.js'>"+"<"+"/script>");
    </script>
    <![endif]-->

    <script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='${ctx}/js/bootstrap/jquery.mobile.custom.js'>"+"<"+"/script>");
    </script>
    <script src="${ctx}/js/bootstrap/bootstrap.js"></script>

    <!-- page specific plugin scripts -->

    <!--[if lte IE 8]>
      <script src="${ctx}/js/bootstrap/excanvas.js"></script>
    <![endif]-->

    <!-- ace scripts -->
	<script src="${ctx}/js/markdown/markdown.min.js"></script>
	<script src="${ctx}/js/markdown/bootstrap-markdown.min.js"></script>
	<script src="${ctx}/js/bootstrap/jquery.hotkeys.min.js"></script> 
	<script src="${ctx}/js/bootstrap/bootstrap-wysiwyg.min.js"></script>
	<script src="${ctx}/js/bootstrap/bootbox.min.js"></script>
	<!-- 多选 -->
	 <script src="${ctx}/js/bootstrap/chosen.jquery.min.js"></script>

    <script src="${ctx}/js/bootstrap/ace-elements.js"></script>
    <script src="${ctx}/js/bootstrap/ace.js"></script>
    
    <script src="${ctx}/js/bootstrap/date-time/bootstrap-datepicker.js"></script>
	<script src="${ctx}/js/bootstrap/date-time/bootstrap-timepicker.js"></script>
    <script src="${ctx}/js/bootstrap/date-time/moment.js"></script>
    <script src="${ctx}/js/bootstrap/date-time/daterangepicker.js"></script>
    <script src="${ctx}/js/bootstrap/date-time/bootstrap-datetimepicker.js"></script>

    <script src="${ctx}/js/common/artDialog.js?skin=blue" type="text/javascript"></script>
	<script src="${ctx}/js/common/iframeTools.js" type="text/javascript"></script>
	<script type="text/javascript" src="${ctx }/js/jqueryValidator/jquery.validationEngine-zh_CN.js"></script>
	<script type="text/javascript" src="${ctx }/js/jqueryValidator/jquery.validationEngine.js"></script>
	<script type="text/javascript" src="${ctx }/js/common/jquery.form.js"></script>
	
	<script type="text/javascript" src="${ctx }/js/ztree/jquery.ztree.core-3.5.js"></script>
	<script type="text/javascript" src="${ctx }/js/ztree/jquery.ztree.excheck-3.5.js"></script>
	
	<script type="text/javascript" src="${ctx }/js/common/page.js"></script>
	<script type="text/javascript" src="${ctx }/js/common/common.js"></script>
	<script type="text/javascript" src="${ctx }/js/uploadFile/swfobject.js"></script>
	<script type="text/javascript" src="${ctx }/js/uploadFile/jquery.uploadify.min.js"></script>
	<script type="text/javascript" src="${ctx }/js/common/jqthumb.js"></script>
	
	<script type="text/javascript" src="${ctx }/js/guanjianzi/tabControl.js"></script>

    
    <script type="text/javascript">
    $(function() {
		$("#mainForm").validationEngine('attach', {promptPosition : "bottomRight:-60,-20", scroll:false,
			autoHidePrompt: true,autoHideDelay: 5000 }); 
		
	});
    (function (config) { 
        config['lock'] = true; 
        config['fixed'] = true; 
        config['yesText'] = '是'; 
	    config['noText'] = '否';  
        // [more..] 
        })(art.dialog.defaults);
    function checkAll(){
     	$('input[name="checkboxs"]').prop("checked",$('#ids').is(":checked")); 
    }
		$(".shortcut01").click(function(){
			$(".nav-list").hide();
			$(".navlist01").show();
		});
		$(".shortcut02").click(function(){
			$(".nav-list").hide();
			$(".navlist02").show();
		});
		$(".shortcut03").click(function(){
			$(".nav-list").hide();
			$(".navlist03").show();
		});
		$(".shortcut04").click(function(){
			$(".nav-list").hide();
			$(".navlist04").show();
		});
		
		$(".project-searchbutton").click(function(){
			if($(".project-searchbox").css("display") == "none"){
			    $(".project-searchbox").slideDown();
				$(".project-searchbutton").html("<i class='icon-chevron-up'></i> 收起查询");
			} else {
				$(".project-searchbox").slideUp();
				$(".project-searchbutton").html("<i class='icon-search'></i> 展开查询");
			};
			
		});
		
		/* $.post('${ctx}/information/count','',function(data){
			$('#infoCount').html(data);
		});
		$.post('${ctx}/information/ajaxList','',function(data){
			var html = '';
			for(var i=0;i<data.result.length;i++){
				html+='<li title="'+data.result[i].content+'"><a ><i class="btn btn-xs btn-primary icon-info"></i>';
				if(data.result[i].content.length>25)
					html+=data.result[i].content.substr(data.result[i].content,25)+'...';
				else
					html+=data.result[i].content;
            	html+='</a></li>';
			}
			$('#info-ul').prepend(html);
		}); */
		
	</script>
    <script type="text/javascript">
	jQuery(function($) {
		$('.date-picker').datepicker({autoclose:true}).next().on(ace.click_event, function(){
			$(this).prev().focus();
		});
		$('input[name=date-range-picker]').daterangepicker({format:"YYYY-MM-DD"}).prev().on(ace.click_event, function(){
			$(this).next().focus();
		});
		
		$('#timepicker1').timepicker({
			minuteStep: 1,
			showSeconds: true,
			showMeridian: false
		}).next().on(ace.click_event, function(){
			$(this).prev().focus();
		});
	});

	</script>
	
	<script type="text/javascript">
		$(document).ready(function(){
			var url = '${menuUrl}'
			if(url != ""){
				var flag = false;
				$("ul[id^=navlist]").each(function(){
					var aObj = $(this).find("a[href='"+url+"?menuUrlSign=1']");
					
					if($(aObj).attr("href") != undefined){
						$(this).show();
						var ul = $(aObj).parent().parent();
						var ulClassP = $(ul).attr("class");
						
						$(aObj).parent().addClass("active");//给选中的连接的li加样式
						
						if(!(ulClassP.indexOf("nav-list navlist") > 0)){//说明有二级或者三级的情况
							$(ul).parent().addClass("open");//li展开
							$(ul).show();//无论是二级或者三级都需要把直接父层show
							
							var ulPPP = $(aObj).parent().parent().parent().parent().parent().parent();
							var ulClassPPP = $(ulPPP).attr("class");
							
							if(ulClassPPP.indexOf("nav-list navlist") > 0){//三级
								$(ul).parent().parent().show();
								$(ul).parent().parent().parent().addClass("open");
							}
						}
						
						/* if(ulClass == "submenu"){//最子层的
							$(ul).show();
							$(aObj).parent().addClass("active");
							$(ul).parent().addClass("open");
							
						}else{
							$(ul).show();
							$(aObj).parent().addClass("active");
						} */
						flag = true;
					}
				});
				if(!flag){
					$("#navlist01").show();	
				}
			}else if(url =="/project/home/home"){
				$("#navlist01").show();//默认业务层show
			}

			$('.submenu').each(function(i){
        		if($.trim($(this).html())==''){
        			$(this).parent('li').remove();
        		}
        	});
			/* $('.nav').each(function(i){
				if($.trim($(this).html())==''){
        			$('.shortcut'+$(this).attr('id').substring(7)).remove();
        		}
			}); */
		});
	</script>
	<!--多选框  -->
	<script type="text/javascript">
		jQuery(function($) {
			$(".chosen-select").chosen(); 
		});
	</script>
	<script type="text/javascript">
	jQuery(function($){
	function showErrorAlert (reason, detail) {
		var msg='';
		if (reason==='unsupported-file-type') { msg = "Unsupported format " +detail; }
		else {
			console.log("error uploading file", reason, detail);
		}
		$('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>'+ 
		 '<strong>File upload error</strong> '+msg+' </div>').prependTo('#alerts');
	}

	//$('#editor1').ace_wysiwyg();//this will create the default editor will all buttons

	//but we want to change a few buttons colors for the third style
	$('#editor1').ace_wysiwyg({
		toolbar:
		[
			'font',
			null,
			'fontSize',
			null,
			{name:'bold', className:'btn-info'},
			{name:'italic', className:'btn-info'},
			{name:'strikethrough', className:'btn-info'},
			{name:'underline', className:'btn-info'},
			null,
			{name:'insertunorderedlist', className:'btn-success'},
			{name:'insertorderedlist', className:'btn-success'},
			{name:'outdent', className:'btn-purple'},
			{name:'indent', className:'btn-purple'},
			null,
			{name:'justifyleft', className:'btn-primary'},
			{name:'justifycenter', className:'btn-primary'},
			{name:'justifyright', className:'btn-primary'},
			{name:'justifyfull', className:'btn-inverse'},
			null,
			{name:'createLink', className:'btn-pink'},
			{name:'unlink', className:'btn-pink'},
			null,
			{name:'insertImage', className:'btn-success'},
			null,
			'foreColor',
			null,
			{name:'undo', className:'btn-grey'},
			{name:'redo', className:'btn-grey'}
		],
		'wysiwyg': {
			fileUploadError: showErrorAlert
		}
	}).prev().addClass('wysiwyg-style2');

	
	$('[data-toggle="buttons"] .btn').on('click', function(e){
		var target = $(this).find('input[type=radio]');
		var which = parseInt(target.val());
		var toolbar = $('#editor1').prev().get(0);
		if(which == 1 || which == 2 || which == 3) {
			toolbar.className = toolbar.className.replace(/wysiwyg\-style(1|2)/g , '');
			if(which == 1) $(toolbar).addClass('wysiwyg-style1');
			else if(which == 2) $(toolbar).addClass('wysiwyg-style2');
		}
	});


	//Add Image Resize Functionality to Chrome and Safari
	//webkit browsers don't have image resize functionality when content is editable
	//so let's add something using jQuery UI resizable
	//another option would be opening a dialog for user to enter dimensions.
	if ( typeof jQuery.ui !== 'undefined' && /applewebkit/.test(navigator.userAgent.toLowerCase()) ) {
		
		var lastResizableImg = null;
		function destroyResizable() {
			if(lastResizableImg == null) return;
			lastResizableImg.resizable( "destroy" );
			lastResizableImg.removeData('resizable');
			lastResizableImg = null;
		}

		var enableImageResize = function() {
			$('.wysiwyg-editor')
			.on('mousedown', function(e) {
				var target = $(e.target);
				if( e.target instanceof HTMLImageElement ) {
					if( !target.data('resizable') ) {
						target.resizable({
							aspectRatio: e.target.width / e.target.height,
						});
						target.data('resizable', true);
						
						if( lastResizableImg != null ) {//disable previous resizable image
							lastResizableImg.resizable( "destroy" );
							lastResizableImg.removeData('resizable');
						}
						lastResizableImg = target;
					}
				}
			})
			.on('click', function(e) {
				if( lastResizableImg != null && !(e.target instanceof HTMLImageElement) ) {
					destroyResizable();
				}
			})
			.on('keydown', function() {
				destroyResizable();
			});
	    }
		enableImageResize();
	}

});
</script>
</body>
</html>